package com.yesep.learn.hik.sdk;

import com.yesep.learn.hik.config.SDKConfig;
import com.yesep.learn.hik.handle.HikHandle;
import com.yesep.learn.hik.utils.SpringUtil;

/**
 * @Description: SDK工具类
 */
public class SDKUtils {

//	private static final HCNetSDK hCNetSDK = HCNetSDK.INSTANCE;
//	private static final PlayCtrl playControl = PlayCtrl.INSTANCE;
	private static final HCNetSDK.NET_DVR_DEVICEINFO_V30 defaultDeviceInfo = new HCNetSDK.NET_DVR_DEVICEINFO_V30();

	public static SDKConfig getSDKConfig() {
		return SpringUtil.getObject(SDKConfig.class);
	}

	public static HCNetSDK getHCNetSDK() {
		return HCNetSDK.INSTANCE;
	}

	//初始化SDK
	public static void initSDK() throws Exception {
		boolean initSuc = HCNetSDK.INSTANCE.NET_DVR_Init();
		if (!initSuc) {
			throw new Exception("海康SDK初始化失败");
		}
	}

	public static PlayCtrl getPlayControl() {
		return  PlayCtrl.INSTANCE;
	}

	public static String getDllPath() {
		return getSDKConfig().getPath();
	}

	public static String getImgPath() {
		return getSDKConfig().getImgPath();
	}

	public static String getVideoPath() {
		return getSDKConfig().getVideoPath();
	}

	public static String getDllFile(String dll) {
		return getDllPath() + dll;
	}

}
